Skip to content

SansIOHttpPolicy can return awaitable objects - #7497

Merged
lmazuel merged 9 commits into
masterfrom
coroutines_sansio
Sep 30, 2019
Merged

SansIOHttpPolicy can return awaitable objects#7497
lmazuel merged 9 commits into
masterfrom
coroutines_sansio

Conversation

@lmazuel

@lmazuel lmazuel commented Sep 30, 2019

Copy link
Copy Markdown
Member

Coroutine being awaitable objects, this means we can define on_request/on_response/on_exception as coroutine (corollary).

@AutorestCI

AutorestCI commented Sep 30, 2019

Copy link
Copy Markdown
Contributor

(message created by the CI based on PR content)

Installation instruction

Package azure-core

You can install the package azure-core of this PR using the following command:
pip install "git+https://github.com/Azure/azure-sdk-for-python@coroutines_sansio#egg=azure-core&subdirectory=azure-core"

You can build a wheel to distribute for test using the following command:
pip wheel --no-deps "git+https://github.com/Azure/azure-sdk-for-python@coroutines_sansio#egg=azure-core&subdirectory=azure-core"

If you have a local clone of this repository, you can also do:

  • git checkout coroutines_sansio
  • pip install -e ./azure-core

Or build a wheel file to distribute for testing:

  • git checkout coroutines_sansio
  • pip wheel --no-deps ./azure-core

Direct download

Your files can be directly downloaded here:

Comment thread sdk/core/azure-core/azure/core/pipeline/policies/base.py Outdated

@annatisch annatisch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

Comment thread sdk/core/azure-core/azure/core/pipeline/base_async.py Outdated
@lmazuel

lmazuel commented Sep 30, 2019

Copy link
Copy Markdown
Member Author

Note: requires #7497 to support AAD async batch

@lmazuel
lmazuel merged commit 827fc57 into master Sep 30, 2019
@lmazuel
lmazuel deleted the coroutines_sansio branch September 30, 2019 23:03
YijunXieMS pushed a commit to YijunXieMS/azure-sdk-for-python that referenced this pull request Oct 9, 2019
* Make BearerTokenCredentialPolicy a SansIOHTTPPolicy

* Allow SansIOHTTPPolicy to return awaitables

* SansIOHttpPolicy doc

* typo

* Awaitable not backported in typing for 2.7 + black

* Fix typing

* Feedbacks from Anna

* Check sync runner doesn't get a coroutine

* pylint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants